package com.laker.admin.module.excel.repository;


import com.laker.admin.module.excel.domain.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * @author : nihongxin
 * @date : 2021/3/22
 */
@Repository
public interface UserRepository extends JpaRepository<User, Long>, JpaSpecificationExecutor<User> {

    /**
     * 根据用户名查询用户信息
     *
     * @param userName 用户名称
     * @return
     */
    @Query(value = "SELECT * FROM user WHERE name = ?1 and del_flag = 0", nativeQuery = true)
    User getUserByName(String userName);
}
